<template>
  <div class="minswiper">
    <div class="minswiperall">
      <swiper :options="swiperOption" v-if="showSwiper">
        <swiper-slide v-for="item of list" :key="item.id">
          <img class="swiper-img" :src="item.imgUrl" />
        </swiper-slide>
        <div class="swiper-pagination"  slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Minswiper',
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        autoplay: 2000,
        loop: true,
        slidesPerView: 3
      },
      list: [{id: '001', imgUrl: 'https://cap.cfae.cn/img/bjnc.png'},
        {id: '002', imgUrl: 'https://cap.cfae.cn/img/hd.png'},
        {id: '003', imgUrl: 'https://cap.cfae.cn/img/tjtp.png'},
        {id: '004', imgUrl: 'https://cap.cfae.cn/img/xers.png'}]
    }
  },
  computed: {
    showSwiper () {
      return this.list.length
    }
  }
}
</script>

<style scoped type="text/stylus" lang="stylus">
.minswiper
  width:100%;height:172px;background-color: #F5F5F5;overflow :hidden
  .minswiperall
    width:1200px;margin:0 auto;margin-top:10px;
    img
      width:387px;height:150px;
</style>
